﻿<UserControl xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"  x:Class="WPFSolution.UserControls.FunctionsDrawer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:UserControls="clr-namespace:WPFSolution.UserControls"
             xmlns:System="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" MinHeight="300" MinWidth="500" >
    <UserControl.Resources>
    </UserControl.Resources>
    <DockPanel>
        <StackPanel DockPanel.Dock="Left">

        </StackPanel>
        <TabControl Name="tabsControl">
            <TabItem Name="graphByGridItem">
                <TabItem.Header>
                    <Label Name="graphNameLabel" Content="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=UserControls:FunctionsDrawer, AncestorLevel=1}, Path=ExpressionName}"></Label>
                </TabItem.Header>
                <chartingToolkit:Chart  Name="graphByPoints" Title="{Binding ElementName=graphNameLabel,Path=Content}" Background="{Binding Source={StaticResource chartAreaGraphBackGroundBrush}}">
                    <chartingToolkit:Chart.Axes>
                        <chartingToolkit:LinearAxis Orientation="X" ShowGridLines="True" Title="X" />
                        <chartingToolkit:LinearAxis Orientation="Y" ShowGridLines="True" 
                                                    Title="{Binding ElementName=graphNameLabel, Path=Content }" />
                    </chartingToolkit:Chart.Axes>
                </chartingToolkit:Chart>
            </TabItem>
            <TabItem Name="naturalGraphItem">
                <TabItem.Header>
                    <StackPanel>
                        <Label>Natural Graphic</Label>
                        <Label Content="{Binding ElementName=graphNameLabel,Path=Content}"></Label>
                    </StackPanel>
                </TabItem.Header>
                <chartingToolkit:Chart Name="naturalGraphic" Background="{Binding ElementName=graphByPoints, Path=Background}" Title="Natural Graphic">
                    <chartingToolkit:Chart.Axes>
                        <chartingToolkit:LinearAxis Orientation="X" ShowGridLines="True" Title="X" />
                        <chartingToolkit:LinearAxis Orientation="Y" ShowGridLines="True" 
                                                    Title="{Binding ElementName=graphNameLabel, Path=Content }" />
                    </chartingToolkit:Chart.Axes>
                </chartingToolkit:Chart>
            </TabItem>
            <TabItem Name="mistakeGraphItem">
                <TabItem.Header>
                    <StackPanel>
                        <Label>Mistake</Label>
                        <Label Content="{Binding ElementName=graphNameLabel,Path=Content}"></Label>
                    </StackPanel>
                </TabItem.Header>
                <chartingToolkit:Chart Name="mistakeGraphic" Background="{Binding ElementName=graphByPoints, Path=Background}" Title="Mistake">
                    <chartingToolkit:Chart.Axes>
                        <chartingToolkit:LinearAxis Orientation="X" ShowGridLines="True" Title="X" />
                        <chartingToolkit:LinearAxis Orientation="Y" ShowGridLines="True" 
                                                    Title="{Binding ElementName=graphNameLabel, Path=Content }" />
                    </chartingToolkit:Chart.Axes>
                </chartingToolkit:Chart>
            </TabItem>
        </TabControl>
    </DockPanel>
</UserControl>
